export default {
  components: {
    MesQcInspectTaskChildList: () => import('@/views/work/auto/MesQcInspectTaskChildList'),
    MesQcInspectTaskChildList2: () => import('@/views/work/auto/MesQcInspectTaskChildList2'),
    MesQcFirstCheckCFOpe: () => import('@/views/work/auto/MesQcFirstCheckCFOpe'),
  },
  data() {
    return {
      mqData: {},
      mqVisible: 1,
      mqLoad: false,
      currentView: ''
    }
  },
  methods: {
    toDetail(item) {
      const { id, isPallet, inspectStatus } = item
      if (inspectStatus === 1) {
        // 1 是线材/组件预制
        this.mqVisible = isPallet === '1' ? 3 : 2
        this.mqData = { id }
      } else {
        this.mqVisible = 4
        this.mqData = {
          id,
          isPallet,
          inspectStatus
        }
      }
      switch (this.mqVisible) {
        case 2:
          this.currentView = 'MesQcInspectTaskChildList'
          break
        case 3:
          this.currentView = 'MesQcInspectTaskChildList2'
          break
        case 4:
          this.currentView = 'MesQcFirstCheckCFOpe'
          break
        default:
          this.currentView = ''
      }
    }
  },
}